IMS CLIENT communication driver

 

 

IMS CLIENT communication driver is the driver to communicate with IMS Server of Samsung Electronics in Korea.

 

Note) IMS CLIENT communication driver enable the communication device when sending data. After the data sending, communication driver disable the communication device.

 

1. Read Settings

 

<Figure 1> is read setting example of IMS CLIENT communication driver.

<Figure 1>  Read setting example of IMS CLIENT communication driver

Device part of  <Figure 1> input Com Port(COM1), Baud Rate(9600), Parity Bit(0), Data Bit(8), Stop Bit(1) respectively, according to the server.

Also you can set 'saving start address of readed string' (0 ~ 9999, default = 0 ), 'received string saving count'(default = 200) by using option part.

 

IMS CLIENT communication driver read schedule

IMS CLIENT communication driver's read schedule input 'READ' one line.

 

 IMS CLIENT communication driver save the received ASCII string to STRING memory in the following order:

If you click the icon  in protocol option part, you can see the dialogue box such as <Figure 2>. you can also set the save position and count by using this part. 

<Figure 2> Example of IMS CLIENT communication driver¡¯s Option dialog box

 

Result and contents of write command

 

<Table 1> is data saving address and contents for each write command.

When the communication error occur, save erroror status value to 'c:\error_msg000.txt' file.

 

Write command Command of contents Data Saving Address

Contents

IN Lot IN output address + 0

error status

2 = normal, 1 = error or communication code bad

OUT Lot OUT output address+ 0

error status

2 = normal, 1 = error or communication code bad

output address+ 1

the basic time

don't save when error

output address+ 2

elapsed time

don't save when error

CHECK Lot CHECK output address+ 0

error status

2 = normal, 1 = error or communication code bad

output address+ 1

Cure time

don't save when error

<Table 1> Data saving address and contents for each write command

Note) You can forcefully change the value of Communication Server by setting Extra1 = #mem# at the analog/digital output tag.

 

2. Writing settings

You can send command by using 'writing settings'. 

 

Digital Write 

Digital write setting parameters are as follows:

1)  PORT                   Port no. (0 ~ 255)

2)  STATION             Don't care.

3)  ADDRESS          Saving address for readed data. ( decimal unit )

4)  Extra1                   Command = IN, OUT, CHECK. ( refer to <Table 1> )

5)  Extra2                   Don't care.

 

Note) Communication data for write command( IN, OUT, CHECK ) have to input at 'C:\cmd_file%03d.txt (%03d = port number)' of 1st line.

After write command, the communication driver delete command file( C:\cmd_file%03d.txt ). So you have to make the command file every write command.

Contents of write command file are as follows.

equipment Name@00@number of employees@Lot ID@                  ( number of employees = 00 or number, etc )

 

Write example 1)

PORT:0,  station:0, ADDRESS:0000, Extra1: IN,  Extra2 : , 1st line contents of 'C:\cmd_file000.txt' = C207@00@91707083@8DH059PA@

The setting parameter shown above is 'C207@11@91707083@8DH059PA@'  + ETX( = 03h ) string sending example. After write command, the result of write command save at 0 address WORD, DWORD, FLOAT memory. ( refer to <Table 1> )

 

Write example 2)

PORT:0,  station:0, ADDRESS:0300, Extra1: OUT,  Extra2 : , 1st line contents of 'C:\cmd_file000.txt' = C207@00@91707083@8DH059PA@

The setting parameter shown above is 'C207@00@91707083@8DH059PA@'  + ETX( = 03h ) string sending example. After write command, the result( 1 = error, 2 = success ) of write command and etc save from 300 address WORD, DWORD, FLOAT memory. ( refer to <Table 1> )

 

Write example 3)

PORT:0,  station:0, ADDRESS:0250, Extra1: CHECK,  Extra2 : , 1st line contents of 'C:\cmd_file000.txt' = C207@00@91707083@8DH059PA@

The setting parameter shown above is 'C207@00@91707083@8DH059PA@'  + ETX( = 03h ) string sending example. After write command, the result( 1 = error, 2 = success ) of write command and etc save from 250 address WORD, DWORD, FLOAT memory. ( refer to <Table 1> )

 

Analog Write

Analog write and digital write have the same setting parameters except output value.

 

3. Terminal screen example for IMS CLIENT communication driver

Terminal screen example of  IMS CLIENT communication driver at SCADA SCADA Server are as follows.

a) Make 20 String tag String and Edit box at Studio.

b) Make digital output tag for writing command at Studil such <Figure 3>. 

<Figure 3> Example of terminal screen at Stuido program

c) Make script at  botton from <Figure 3> in order to see previous command.

Function

Contents

to see previous command at terminal screen

if(pos == $scroll_pos) return;

pos = $scroll_pos;

 

for(i = 0; i < 20; i = i+1) {

   @sprintf(tag_name, "ST_%02d.address", i);

   @SetTagValue(tag_name, pos+i);

}

<Table 2> Script example for previous command at terminal screen

d) Please check( v ) and select 'Key Down' at Expand tab at Edit box such as <Figure 3>. Then, <Figure 4> will be opened.

e) At <Figure 4>, please make Key Down script such as <Table 3> and <Figire 5>.

f) Also, select tag that store the contents of Edit box at Tag tab.( example : STRING02 )

g) <Figure 6> is terminal screen example at SCADA Server.

<Figure 4> Example of Expand tab at Edit box
Function Contents

script example when pressing 'enter' key

for writing command(command = input string)

 

retn = @KeyGetCode();

if(retn != 13) return;    // don't Enter key, return

 

if(@strnicmp($STRING01, "IN", 2) == 0) lot_code = 11;

elseif(@strnicmp($STRING01, "OUT", 3) == 0) lot_code = 21;

elseif(@strnicmp($STRING01, "CHECK", 5) == 0) lot_code = 91;

else {

   @EditBoxSetText("EditBox1", "");

   return;

}

 

handle  = @FileOpen("C:\\cmd_file000.TXT", "w");

if(handle == 0) return;

 

buf[0] = 0;

 

@sprintf(buf, "%s@00@%s@%s", $MACHINE_ID, $USER_NO, $LOT_NO);

length = @strlen(buf);

if(length == 0)

   @FileWrite(handle, " ", 1);

else

   @FileWrite(handle, buf, length);

@FileClose(handle);

 

if(lot_code == 11) @sprintf($DO_EXEC.extra1, "IN");

elseif(lot_code == 21) @sprintf($DO_EXEC.extra1, "OUT");

else @sprintf($DO_EXEC.extra1, "CHECK");

$DO_EXEC = 0;

@EditBoxSetText("EditBox1", "");

<Table 3> Script example when pressing 'enter' key
<Figure 5> 'KeyDown' script example of EditBox
 
<Figure 6> Terminal screen example at SCADA Server